'use strict';
(function() {

    function initData(scope, state){
        scope.title = state.label;
        scope.description = state.description;
        scope.progress = state.progress;
    }

    ngApp.directive("showcaseHeadline", ['$rootScope', '$state', 'AppConfigConstant', function($rootScope, $state, AppConfigConstant) {
        var appBasePath = AppConfigConstant.APP_BASE_PATH;
        return {
            'restrict': 'E',
            'replace': false,
            scope: {},
            templateUrl: appBasePath + "showcase/directive/showcase-headline/view/showcase-headline.html",
            link: function(scope, element, attrs) {

                $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
                    initData(scope, toState);
                });

                initData(scope, $state.current);
            }
        };
    }]);


})();